var timeoutId;
var blackboxElement;
$(document).ready(function () {
    if ($('script[src="1.js"]').length > 0) {
        blackboxElement = document.getElementById("eeBlackBox");
        if (typeof (blackboxElement) != 'undefined' && blackboxElement != null) {
            timeoutId = setInterval(send_bb, 200);
            setTimeout(function () {
                clearTimeout(timeoutId);
            }, 2000);
        }
    }
});

function send_bb() {
    var bbData = E2GetBlackbox();
    if (bbData != null && bbData.blackbox) {
        document.getElementById('eeBlackBox').value = bbData.blackbox;
        if (bbData.finished) {
            clearTimeout(timeoutId);

        }
    }
}